{include file="public/header" /}
<link rel="stylesheet" href="/static/admin/builder/css/base.css" media="all">
<style>
	#table th,#table td{
		text-align: center;
	}
	.x-sort{
		height: 24px !important;
	}
</style>
<body>
<div class="layui-fluid layui-anim layui-anim-upbit">
	<div class="layui-card" style="padding-top: 5px">
		<div class="layui-card-body">
			<div>
				<div class="layui-btn-container">
<!--					<a class="layui-btn layui-btn-normal layui-btn-sm" onclick="zhiju_show('添加','{:url(\'edit\',[\'id\'=>0])}',1000,800)">-->
<!--						<i class="layui-icon layui-icon-add-circle-fine"></i>新增-->
<!--					</a>-->
					<a class="layui-btn layui-btn-sm" style="background: #17a2b8" onclick="openAllCate($(this));">
						<i class="layui-icon layui-icon-util"></i><span class="show_text">展开</span>
					</a>
				</div>
			</div>
			<table class="layui-table layui-form" id="table" lay-size="sm">
				<thead>
				<tr>
					<th>分类名称</th>
					<th>图标</th>
					<th>添加时间</th>
					<th>修改时间</th>
					<th width="80px">排序</th>
					<th width="80px">状态</th>
					<th width="220px;">操作</th>
				</thead>
				<tbody>
				{foreach name="list" id="v"}
				<?php if($v['pid'] == 0){ $ppid = $v['id']; } ?>
				<tr cate-id='{$v.id}' fid='{$v.pid}' level="{if $v.pid <= 0}0{else}{$v.lvl}{/if}" class="{if $v.lvl>1}layui-anim layui-anim-up layui-anim-downbit showAll{/if}" {if $v.lvl>1}style="display: none" {/if}>
					<td>
						{if $v.left_px > 0}
						<span style="padding-left: 30px;"></span>
						|— {$v.title}
						{else}
						<i class="layui-icon x-show" status='true'>&#xe623;</i>
						{$v.title}
						{/if}
					</td>
					<td>{if $v.lvl <= 1 }<a href="{$v.icon?:''}" target="_blank"><img src="{$v.icon?:''}" style="width: 40px;"/></a>{/if}</td>
					<td>{$v.create_time}</td>
					<td>{$v.update_time}</td>
					<td><input type="text" data-key="sort" data-id="{$v.id}" data-url="{:url('update',['key'=>'sort','id'=>$v.id])}" value="{$v.sort}" class="layui-input x-sort tableInput"/></td>
					<td class="td-status" style="text-align: center;">
						<input type="checkbox" lay-text="显示|隐藏" {if $v.status=='1'}checked{/if} lay-skin="switch" lay-filter="switch" url="{:url('update',['key'=>'status','id'=>$v.id])}"/>
					</td>
					<td class="td-manage">
						<div class="layui-btn-group">
							<button class="layui-btn layui-btn-sm right_button" onclick="zhiju_show('编辑','{:url(\'edit\',[\'id\'=>$v.id,\'pid\'=>$v.pid])}','900','800')">编辑</button>

							<button class="layui-btn layui-btn-info layui-btn-sm right_button" onclick="zhiju_show('添加子分类','{:url(\'edit\',[\'id\'=>0,\'pid\'=>$v.id])}',900,800)">添加子分类</button>
							{if $v.pid>0}
							<button class="layui-btn-danger layui-btn layui-btn-sm right_button" onclick="destroys(this,'{:url(\'delete\')}','{$v.id}')">删除</button>
							{/if}
						</div>
					</td>
				</tr>
				{/foreach}
				</tbody>
			</table>

		</div>
	</div>
</div>
</body>
{include file="public/footer" /}
</html>